<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>set</title>
</head>
<body>
<script>
    //set集合特点 无序排序,可去重复
    let set = new Set();
    set.add("tom");
    set.add("Tom");
    set.add("vvvvvvv");
    set.add("Jerry");
    set.add("Jerry");
    set.add("aaaaaa");
    for(let name of set){
        console.log(name);
    }
    set.size;//长度
    let arr = [2,3,4,4,5,6,2];
    let numset = new Set();
    for(let num of arr){
        numset.add(num);
    }
    for(let num of numset){
        console.log(num);
    }
</script>
</body>
</html>